package com.kamistoat.meimeichatserveraggrement.protocol.p2p;

import com.kamistoat.meimeichatserveraggrement.protocol.Command;
import com.kamistoat.meimeichatserveraggrement.protocol.Packet;

/**
 * 两个客户端之间的应答信息。当某个客户端收到该应答信息时，意味着两者间的P2P连接一定建立成功
 */
public class UDP_AnswerP2PClient2Client extends Packet {
    /**
     * 对方的UserId
     */
    private String targetUserId;

    /**
     * 确认状态 0-半确认 1-全确认。
     * 半确认状态下需要回传应答信息，全确认状态不需要回传映带信息
     */
    private Integer confirmStatus;

    public UDP_AnswerP2PClient2Client() {
    }

    public UDP_AnswerP2PClient2Client(String targetUserId, Integer confirmStatus) {
        this.targetUserId = targetUserId;
        this.confirmStatus = confirmStatus;
    }

    public String getTargetUserId() {
        return targetUserId;
    }

    public void setTargetUserId(String targetUserId) {
        this.targetUserId = targetUserId;
    }

    public Integer getConfirmStatus() {
        return confirmStatus;
    }

    public void setConfirmStatus(Integer confirmStatus) {
        this.confirmStatus = confirmStatus;
    }

    /**
     * 获取协议指令
     *
     * @return 返回指令值
     */
    @Override
    public Byte getCommand() {
        return Command.UDP_AnswerP2PClient2Client;
    }
}
